package com.topscomm.mis.cbb.pm.enumerate;

/**
 * @description: 任务状态枚举
 * @return
 * @author: wangxinhua
 * @date: 2023/6/20 19:24
 * @modify:
 */
public enum TaskStatusEnum {
  LOSE(-2, "已失效"),
  CUT(-1, "被裁减"),
  NOTSTART(0, "未开始"),
  READYSTART(1, "待进行"),
  RUNNING(2, "进行中"),
  BACK(3, "已退回"),
  CANCEL(4, "已取消"),
  CONFUSION(5, "待确定"),
  COMPLETE(9, "已完成");

  private final int number;
  private final String name;

  TaskStatusEnum(int number, String name) {
    this.number = number;
    this.name = name;
  }

  public int getNumber() {
    return number;
  }

  public String getName() {
    return name;
  }

  public static String getNameByNumber(int number) {
    for (TaskStatusEnum taskStatus : TaskStatusEnum.values()) {
      if (taskStatus.getNumber() == number) {
        return taskStatus.getName();
      }
    }
    return null;
  }
}
